package com.hy.controller;

import com.hy.service.IUms_memberService;
import com.hy.utils.HY_Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

//@CrossOrigin
@RestController
@RequestMapping("/hy-frontuser-consumer/ums_member")
public class Ums_memberController {

    //会员 服务
    @Autowired
    private IUms_memberService iUms_memberService;

    /**
     * 手机验证码注册
     * @param phone
     * @param province
     * @param city
     * @param password
     * @return
     */
    @PostMapping("/phoneCodeReg.action")
    public HY_Result phoneCodeReg(@RequestParam String phone,@RequestParam String code, @RequestParam String province, @RequestParam String city,@RequestParam String password) {
        return iUms_memberService.phoneCodeReg(phone,code,province,city,password);
    }

    /**
     * 第三方注册
     * @param qlmap
     * @return
     */
    @PostMapping("/third_reg.action")
    public HY_Result third_Reg(@RequestBody Map<String,Object> qlmap) {
        return iUms_memberService.third_Reg(qlmap);
    }

    /**
     * 用户名验证会员是否注册
     * @param username
     * @return
     */
    @RequestMapping("/userNameVerify.action")
    public HY_Result userNameVerify(@RequestParam String username){
        return iUms_memberService.userNameVerify(username);
    }

    /**
     * 手机号验证会员是否注册
     * @param phone
     * @return
     */
    @RequestMapping("/phoneVerify.action")
    public HY_Result phoneVerify(@RequestParam String phone){
        return iUms_memberService.phoneVerify(phone);
    }

    /**
     * 手机号-密码-登录
     * @param phone
     * @param password
     * @return
     */
    @PostMapping("/phonePwdLogin.action")
    public HY_Result phonePwdLogin(@RequestParam String phone,@RequestParam String password){
        return iUms_memberService.phonePwdLogin(phone,password);
    }

}
